import Vue from "vue";
import Vuex from "vuex";

// import store from 'store';
// 获取
let sid = sessionStorage.getItem("sid");
sid = sid ? JSON.parse(sid) : "";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    sid: sid,
    userData: null
  },
  mutations: {
    setSid(state, sid) {
      // 设置登陆sid
      state.sid = sid;
    },
    setUserData(state, userData) {
      // 设置用户信息
      state.userData = userData;
    }
  },
  actions: {},
  modules: {}
});
